#include <iostream>
using namespace std;
class Pet
{
public:
    virtual void speak() const = 0;
    virtual void eat() const = 0;
    // virtual void sleep() const =0{

    // }; 不行不能内联
};

void Pet::eat() const
{
    cout << "Pet::eat()" << endl;
}

void Pet::speak() const
{
    cout << "Pet::speak()" << endl;
}

class Dog : public Pet
{
public:
    void speak() const
    {
        Pet::speak();
    };
    void eat() const
    {
        Pet::eat();
    };
};
class Cat : public Pet
{
    public:
    void speak() const
    {
        cout << "Cat::eat()" << endl;
    };
    void eat() const
    {
        cout << "Cat::eat()" << endl;
    };
};
